//
//  HXGiftFirst.m
//  GiftSay
//
//  Created by laohu on 16/1/12.
//  Copyright © 2016年 liyinkai. All rights reserved.
//

#import "HXGiftFirstModel.h"
#import "HXGiftSecondModel.h"
@implementation HXGiftFirstModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.ids = value;
    }
    
    if ([key isEqualToString:@"subcategories"]) {
        NSMutableArray *arr = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            HXGiftSecondModel *second = [[HXGiftSecondModel alloc] init];
            [second setValuesForKeysWithDictionary:dic];
            [arr addObject:second];
        }
        self.subcategory = [NSMutableArray arrayWithArray:arr];
    }
}
- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}
@end
